package com.diaohw.module.file.obj.convert;

import com.diaohw.module.file.obj.dto.FileDTO;
import com.diaohw.module.file.obj.entity.FileDO;
import com.diaohw.module.file.obj.vo.FileVO;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * <p>
 * 文件信息 类型转换
 * </p>
 *
 * @author D-Hw
 * @since 2024-09-20
 */
@Mapper
public interface FileConvert {

    FileConvert INSTANCE = Mappers.getMapper(FileConvert.class);

    /**
     * dto to entity
     */
    @InheritConfiguration
    FileDO dtoToEntity(FileDTO dto);

    /**
     * entity to dto
     */
    @InheritConfiguration
    FileDTO entityToDto(FileDO entity);

    /**
     * entity to dto
     */
    @InheritConfiguration
    FileVO entityToVo(FileDO entity);

    /**
     * entity to dto
     */
    @InheritConfiguration
    List<FileVO> entityToVo(List<FileDO> list);


}

